package com.easybbs.entity.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

/**
 * @Author: yudaxian
 * @Description: 验证码状态
 * @DateTime: 2024/10/18 14:21
 **/
@Getter
@AllArgsConstructor
@NoArgsConstructor
public enum EmailCodeStatusEnum {
    UN_USED(0, "未使用"),
    USED(1, "已使用"),
    ;

    private Integer code;

    private String desc;

    public static EmailCodeStatusEnum getByCode(Integer code) {
        for (EmailCodeStatusEnum e : EmailCodeStatusEnum.values()) {
            if (e.getCode().equals(code)) {
                return e;
            }
        }
        return null;
    }
}
